﻿@model Achievement.DataModels.Users
@{
    ViewBag.Title = "EditInfo";
}
@section LayoutHeadContainer{
<link href="/css/jquery-ui-1.10.2.custom.css" rel="stylesheet">
	<script src="/js/jquery-1.9.1.js"></script>
	<script src="/js/jquery-ui-1.10.2.custom.js"></script>
<script>
    $(function () {
        $("#tabs").tabs();
        $("#button").button();
    });

    function checkempty() {
        var result = true;
        $(".ckempty").each(function () {
            if ($(this).val() == "") {
                $(this).next("span").text(" 值不能为空！");
                result = false;
            }
        });
        if ($("#PassWord").val() != $("#txtConfirmPWD").val()) {
            $("#txtConfirmPWD").next("span").text(" 确认密码不一致！");
            result = false;
        }
        return result;
    }
</script>
}
<div id="middle-sdo1">
  <div id="middle">
    <!--Message-->
    <div class="message">北京电力工程公司成果库系统欢迎您！</div>
    <!--Feature Box-->
    <div style="text-align:right;padding-bottom:5px">
    
    </div>
    <div id="tabs" style=" text-align:center">
	    <ul>
		    <li><a href="#tabs-1">个人资料</a></li>
	    </ul>
	    <div id="tabs-1" style="text-align:center; margin-left:auto;">
        @using (Html.BeginForm("SaveInfo", "Users", FormMethod.Post, new { id = "form",enctype = "multipart/form-data", onsubmit = "return checkempty()" }))
        {
            <table width="500px" style="margin-left:auto; margin-right:auto; line-height:40px">
                <tr>
                    <td style="text-align:right;">
                        <h5>头像：</h5>
                    </td>
                    <td style="text-align:left;">
                        <img style=" height:100px; width:100px" src='@(string.IsNullOrEmpty(Model.Image)?"/images/wutu.jpg":"/UploadFile/"+Model.Image)' />
                        @Html.HiddenFor(model=>model.ID)
                        <br />
                        <input type="file" name="file1" id="file1" />
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>登录名：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model => model.LoginName, new { @class="ckempty"})
                        <span style=" color:Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>密码：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.PasswordFor(model => model.PassWord, new { @class = "ckempty" })<span style=" color:Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>确认密码：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.Password("txtConfirmPWD","", new { @class = "ckempty" })<span style=" color:Red">*</span>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>姓名：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model=>model.Name)
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>工号：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model=>model.WorkNumber)
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>职务：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model=>model.Position)
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>所在部门：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model=>model.Department)
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>工作时间：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextBoxFor(model=>model.WorkDate)
                    </td>
                </tr>
                <tr>
                    <td style="text-align:right;">
                        <h5>描述：</h5>
                    </td>
                    <td style="text-align:left;">
                        @Html.TextAreaFor(model => model.Resume, new { style = " height:150px; width:300px"})
                    </td>
                </tr>
            </table>
            }
        </div>
        <button id="button" onclick="$('form').submit()">保存</button>
        <br />
        <br />
        <br />
    </div>
    
  </div>
</div>